// components/author/author.js
const app=getApp()
Component({
    data:{
      token1:'1111',
    },
    lifetimes:{
      //封装组件
      attached(){
        //相当于mounted
        console.log(app.token1,111)
        this.setData({
          token1:app.token
        })
        //判断是否有token
        if(!app.token1){
            wx.navigateTo({
              url: '/pages/login/login',
            })
        }
      }

      
    }
})
